package com.example.demo.controller;

import com.example.demo.dao.RoleMapper;
import com.example.demo.model.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/role")
public class RoleController {

    @Autowired
    private RoleMapper roleMapper;

    @RequestMapping("/get/{roleId}")
    public Role getRoleById(@PathVariable("roleId") Integer roleId){

        return roleMapper.selectById(roleId);

    }
}
